﻿#region << 文件说明 >>
/*----------------------------------------------------------------
 * 命名空间：Vampirewal.ToolCenter.JsonTool
 * 唯一标识：0411bdab-6059-4f15-bf85-7a6b16f8e9b4
 * 文件名：Startup
 * 
 * 创建者：杨程
 * 电子邮箱：235160615@qq.com
 * 创建时间：2023/12/27 11:26:02
 * 版本：V1.0.0
 * 描述：
 *
 * ----------------------------------------------------------------
 * 修改人：
 * 时间：
 * 修改说明：
 *
 * 版本：V1.0.1
 *----------------------------------------------------------------*/
#endregion << 文件说明 >>

using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Vampirewal.Core;
using Vampirewal.Core.Extensions;
using Vampirewal.Core.Interface;
using Vampirewal.Core.SimpleMVVM;
using Vampirewal.ToolCenter.Plugin;

namespace Vampirewal.ToolCenter.JsonTool;

/// <summary>
/// 
/// </summary>
public partial class Startup:IStartupBase
{
    /// <summary>   
    /// 构造函数
    /// </summary>
    public Startup()
    {
        
    }

    public void OnAppRun(bool IsRun)
    {
        var dialog= VampirewalCoreContext.GetInstance().GetService<IVampirewalCoreDialogMessage>();
        dialog.ShowPopupWindow(new Core.WindoSetting.PopupWindowSetting()
        {
            Message="JSON工具启动了",
            OwnerWindow=WindowsManager.GetInstance().MainWindow,
            Type= Core.WindoSetting.MessageType.Successful
        });
    }

    public void RegisterConfig(List<IOptions> options)
    {
        options.RegisterOptions<TestOptions>();
    }

    public void RegisterService(IServiceCollection services)
    {
        services.AddSingleton<ITestInterface, TestInterface>();
    }
}

public class TestOptions : IOptions
{
    public string TestName { get; set; }

    public int TestAge { get; set; }
}

public interface ITestInterface
{
    string Name { get; set; }
}

public class TestInterface : ITestInterface
{
    public string Name { get; set; } = "请输入JSON内容";
}